<script setup lang="ts">
const props = defineProps({
  label1: {
    type: String,
    required: true,
  },
  label2: {
    type: String,
    default: '默认标签',
  },
  number: {
    type: Number,
    required: true,
  },
})
</script>

<template>
  <div class="item">
    <div class="left">
      <div>
        <slot name="icon"></slot>
      </div>
      <p class="label1">{{ props.label1 }}</p>
    </div>
    <div class="right">
      <p class="label2">{{ props.label2 }}</p>
      <p class="number">{{ props.number.toLocaleString() }}</p>
    </div>
  </div>
</template>

<style scoped>
.item {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 20%;
  min-width: 200px;
  padding: 10px;
  border: 1px solid #ccc;
}

.item .left,
.item .right {
  height: 70px;
  flex: 0 0 auto;
}

.item .left {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 70px;
  border-radius: 1000px;
  background-color: #108eff;
}

.item .label1 {
  font-size: 0.7rem;
  color: #fff;
}

.item .label2 {
  font-size: 0.9rem;
  color: rgba(0, 0, 0, 0.6);
}

.item .number {
  font-size: 2rem;
}
</style>
